package com.nuhu.dao;

import com.nuhu.pojo.ComplaintRecord;
import com.nuhu.pojo.User;
import com.nuhu.pojo.Worker;
import com.nuhu.pojo.admin_Search_HUAFEI;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper //在运行时，会自动生成该接口的实现类对象（代理对象），并且将该对象交给IOC容器管理
public interface admin_Search_HUAFEIDAO {

    @Select("SELECT * FROM users WHERE Phone_Number = #{phoneNumber}")
    User getUserByPhoneNumber(String phoneNumber);
    @Select("SELECT * FROM users where Ban_Status = 1 LIMIT #{offset}, #{size}")
    List<User> getBannedUser(@Param("offset") int offset, @Param("size") int size);

    @Update("update users set Ban_Status = 0 where Phone_Number = #{phoneNumber}")
    User updateBan(String phoneNumber);

    @Select("SELECT * FROM complaint_record LIMIT #{offset}, #{size}")
    List<ComplaintRecord> getFanKui(@Param("offset") int offset, @Param("size") int size);
}
